// AWTTextArea.h: interface for the AWTTextArea class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AWTTEXTAREA_H__85E1300D_F045_488C_BD9B_743839AAF06C__INCLUDED_)
#define AFX_AWTTEXTAREA_H__85E1300D_F045_488C_BD9B_743839AAF06C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "AWTTextComponent.h"

class AFX_EXT_CLASS AWTTextArea : public AWTTextComponent
{
DECLARE_DYNAMIC(AWTTextArea)
public:
	AWTTextArea()
	{
		construct(CString(), 0, 0);
	}
	AWTTextArea(LPSTR text)
	{
		construct(CString(text), 0, 0);
	}
	AWTTextArea(CString text)
	{
		construct(CString(), 0, 0);
	}
	AWTTextArea(int rows, int columns)
	{
		construct(CString(), rows, columns);
	}
	AWTTextArea(LPSTR text, int rows, int columns)
	{
		construct(CString(text), rows, columns);
	}
	AWTTextArea(CString& text, int rows, int columns)
	{
		construct(text, rows, columns);
	}
	virtual ~AWTTextArea();

	void construct(CString& text, int rows, int columns)
	{
		setBackground(AWTColor::white());
		m_rows = rows;
		m_columns = columns;
	}
	
  int getRows() 
	{
		return m_rows;
  }

  void setRows(int rows) 
	{
		if (rows != m_rows) 
		{
	    m_rows = rows;
	    invalidate();
		}
  }

  int getColumns() 
	{
		return m_columns;
  }

  void setColumns(int columns) 
	{
		if (columns != m_columns) 
		{
	    m_columns = columns;
	    invalidate();
		}
  }

	CSize minimumSize(int rows, int columns);
	CSize minimumSize();
	CSize preferredSize(int rows, int columns);
	CSize preferredSize();

protected:
	CWnd* createComponent();

	int	m_rows;
  int	m_columns;
};

#endif // !defined(AFX_AWTTEXTAREA_H__85E1300D_F045_488C_BD9B_743839AAF06C__INCLUDED_)
